package com.managermype.dao.interfaces;

import java.util.List;

import org.springframework.dao.DataAccessException;

import com.managermype.domain.User;

/**
 * 
 * @author juandiego
 *
 */
public interface UserDao {

	/**
	 * 
	 * @param user
	 * @return
	 * @throws DataAccessException
	 */
	public User insert(User user) throws DataAccessException;
	
	/**
	 * 
	 * @param user
	 * @throws DataAccessException
	 */
	public void update(User user) throws DataAccessException;
	
	/**
	 * 
	 * @param username
	 * @param password
	 * @return
	 * @throws DataAccessException
	 */
	public User login(String username, String password) throws DataAccessException;

	/**
	 * 
	 * @param idUser
	 * @return
	 * @throws DataAccessException
	 */
	public User getById(Integer idUser) throws DataAccessException;
	
	/**
	 * 
	 * @param username
	 * @return
	 * @throws DataAccessException
	 */
	public User getByUsername(String username) throws DataAccessException;

	/**
	 * 
	 * @param name
	 * @return
	 * @throws DataAccessException
	 */
	public List<User> listByName(String name) throws DataAccessException;
	
	/**
	 * 
	 * @param idUser
	 * @throws DataAccessException
	 */
	public void deleteById(Integer idUser) throws DataAccessException;

}
